1. Field of the Invention
The present invention relates to an image processing apparatus for expressing a model by a combination of unit graphics and generating pixels in a drawn object region of a screen coordinate system and a method of the same.
2. Description of the Related Art
Along with also the improvement of operating speeds and the strengthening of graphic drawing functions in recent computer systems, computer graphics (CG) technology for using computer resources to prepare and process graphics and images is currently the subject of active research and development efforts and is being put into practical use.
For example, in three-dimensional graphics, the optical phenomenon when a three-dimensional object is illuminated by a predetermined light source is expressed by a mathematics model and the surface of the object is given shading or lighting or given a pattern based on this model to thereby to generate a more realistic, three-dimensional-like two-dimensional high quality image.
Such computer graphics is being increasingly utilized in CAD/CAM in the development field of science, industry, manufacture, etc. and other various types of fields of application.
Three-dimensional graphics is generally comprised by a geometry sub-system positioned as the front end and a raster sub-system positioned as the back end.
The “geometry sub-system” is the step for performing geometric operation on a position, posture, etc. of a three-dimensional object displayed on a display screen.
In the geometry sub-system, the object is generally handled as an aggregate of a large number of polygons, and geometric operation such as coordinate conversion, clipping, and light source calculation are performed in units of polygons.
On the other hand, the “raster sub-system” is the step for painting each pixel constituting the object.
The rasterizing is realized by for example interpolating the image parameters of all pixels included inside a polygon on the basis of the image parameters found for the vertexes of the polygon.
The image parameters referred to here include color (drawn color) data expressed by a so-called RGB format or the like, a z-value expressing a distance in a depth direction, and so on.
Further, in recent high definition three-dimensional graphics processing, a fog (f)) for causing a perspective feeling, a texture (t) for expressing the feeling of the material and pattern of the object surface to impart realism, etc. are also included as image parameters.
Here, the processing for generating pixels inside a polygon from the vertex information of the polygon is executed by using a linear interpolation technique frequently referred to as a “digital differential analyzer” (DDA).
In the DDA process, the inclination of data to a side direction of the polygon is found from the vertex information, the data on the side is calculated by using this inclination, then the inclination of a raster scan direction (X-direction) is calculated, and the amount of change of the parameter found from this inclination is added to the parameter values of the start point of the scan so as to generate internal pixels.
At this time, there is a method of simultaneously generating a plurality of pixels by scanning in units of regions instead of scanning in units of pixel.
As one of these, there is the method disclosed in Japanese Unexamined Patent Publication (Kokai) No. 2000-338959 (Japanese Patent Application No. 11-152702 (Document 1)).
This method calls for simultaneously processing pixels existing in a square region and transferring the pixels together to a later stage of processing as square region data so as to improve the speed of drawing pixels.
In the above method for processing pixels in units of regions, however, for example, where the region is a square region, there is a disadvantage that sometimes the processed region will not include even one valid pixel.
For example, as shown in FIG. 1, when processing in units of 2×2 regions to judge if center points of the pixels are included in a triangular region, the regions indicated by numerals 1, 2, and 3 in the figure will be scanned but will not include any valid pixels.
In this case, the data is not transferred to the later stage of processing, so the operating efficiency of the later stage of processing will end up falling.